#pragma once
#include "node.h"
#include "Input.h"
#include "Output.h"
#include <vector>
class Gate :
	public Node
{
protected:
	Gate( const char* );
public:
	Gate();
	void notify();
	virtual void Calculation() = 0;
	Input* GetInputForLink();
	void LinkOutputWith(Input* input);
	virtual Node* clone() = 0;
	~Gate(void);
private:
	vector<Input*> inputs;
	Output *output;
	int linkedInputs;
	bool AllInputsWereSet();
protected:
	Input* GetInput(int i);
	const vector<Input*> GetInputs();
	Output* GetOutput();
	void AddInput(Input* input);
	void SetOutput(Output* output);
	void LinkInputsWithGate();
	int GetLinkedInputs();
	
};

